#include "../lib_include/Poller.h"
#include "../lib_include/PollPoller.h"
#include "../lib_include/EPollPoller.h"

// 默认的IO复用模型poll/epoll

#include <stdlib.h>

using namespace netlib::net;

Poller* Poller::newDefaultPoller(EventLoop* loop)
{
    if (::getenv("NETLIB_USE_POLL")) // 如果存在环境变量，则使用poll，反之使用epoll
        return new PollPoller(loop);
    else
        return new EPollPoller(loop);
}
